
import { request } from './request'
import qs from 'qs'

export function getMenus(obj) {
    return request({
        url: 'backLogin/listMenu',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 获取门店列表
export function getShopList(obj) {
    return request({
        url: 'shop/getShopList',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 获取门店相册
export function getShopImg(obj) {
    return request({
        url: 'shop/getShopPicList',
        method: 'post',
        data: qs.stringify(obj)
    })
}
export function listAuth(obj) {
    return request({
        url: 'shop/listshopAuth',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function addAuth(obj) {
    return request({
        url: 'shop/addshopAuth',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function searchShop(obj) {
    return request({
        url: 'searchShopShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

// 获取门店列表
export function changeShopStatus(obj) {
    return request({
        url: 'shop/getShopList',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 获取门店入驻信息
export function getShopInfos(obj) {
    return request({
        url: 'shop/getShopInfos',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function updateShop(obj) {
    return request({
        url: 'shop/updateShop',
        method: 'post',
        data: qs.stringify(obj)
    })
}

// 添加门店 
export function submitShop(obj) {
    return request({
        url: 'shop/addOrEditShop',
        headers: { 'content-type': 'multipart/form-data' },
        method: 'post',
        data: obj
    })
}

export function getPhoto(obj) {
    return request({
        url: 'shopPicShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function deletePhoto(obj) {
    return request({
        url: 'shop/deleteShoppic',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function addPhoto(obj) {
    return request({
        url: 'shop/addShoppic',
        headers: { 'content-type': 'multipart/form-data' },
        method: 'post',
        data: obj
    })
}

// 获取分店信息
export function childShop(obj) {
    return request({
        url: 'shop/childShop',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function getAuths(obj) {
    return request({
        url: 'getAuthsShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function addAuthRole(obj) {
    return request({
        url: 'addAuthRoleShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function deleteAuthRole(obj) {
    return request({
        url: 'deleteAuthRoleShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

// 关闭门店
export function closeShop(obj) {
    return request({
        url: 'shop/closeShop',
        method: 'post',
        data: qs.stringify(obj)
    })
}
//开启门店
export function openShop(obj) {
    return request({
        url: 'shop/openShop',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function getShops(obj) {
    return request({
        url: 'getShopsShopAction.action',
        method: 'post',
        data: qs.stringify(obj)
    })
}

// 开启 关闭 领鸡蛋
export function updateShopFreeCard(obj) {
    return request({
        url: 'shop/openOrCloseGetEgg',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function getProvinceList(obj) {
    return request({
        url: 'common/getProvinceList',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function getCity(obj) {
    return request({
        url: 'common/getCity',
        method: 'post',
        data: qs.stringify(obj)
    })
}

export function getArea(obj) {
    return request({
        url: 'common/getArea',
        method: 'post',
        data: qs.stringify(obj)
    })
}

// 设置店长
export function addShopOwner(obj) {
    return request({
        url: 'shop/addShopOwner',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 修改门店绑定事业部
export function updateShopDepart(obj) {
    return request({
        url: 'shop/updateShopDepartmenrt',
        method: 'post',
        data: qs.stringify(obj)
    })
}


// 修改门店是否可上传全平台商品
export function updateShopAllPlatform(obj) {
    return request({
        url: 'shop/updateShopAllPlatform',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 获取消息通知
export function listNotice(obj) {
    return request({
        url: 'data/listNotice',
        method: 'post',
        data: qs.stringify(obj)
    })
}
// 已读消息通知
export function readNotice(obj) {
    return request({
        url: 'data/readNotice',
        method: 'post',
        data: qs.stringify(obj)
    })
} 
